package com.paopao.common;

import com.github.pagehelper.PageInfo;
import com.paopao.domain.ObjectListResult;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ServiceHandler {
	
	public static <I> ObjectListResult paging(List<I> list){
		PageInfo<I> pageInfo = (PageInfo<I>) new PageInfo<>(list);
		//返回的是当前页和总条数
		ObjectListResult listResult = new ObjectListResult(list, pageInfo.getPageNum(), pageInfo.getTotal());
		return listResult;
		        
	}
}  
	
	
	

